package com.project.controller;

import com.project.bean.CountSellBean;
import com.project.service.ICountSellService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

@RestController
@RequestMapping("countSell")
public class CountSellController {
    @Autowired
    private ICountSellService countSellService;
    
    @RequestMapping("findByItem")
    public List<CountSellBean> findByItem(LocalDate startDate, LocalDate endDate) {
        return countSellService.findByItem(startDate, endDate);
    }
    @RequestMapping("findByProduct")
    public List<CountSellBean> findByProduct(LocalDate startDate, LocalDate endDate) {
        return countSellService.findByProduct(startDate, endDate);
    }
}
